﻿using System;
using System.Collections.Generic;
using System.IO;

namespace DiskUsage
{
    public class MyComputer : DirectoryPresentationBase
    {

        public override string Name
        {
            get { return "My Computer"; }
        }

        public override string Icon
        {
            get { return "Resources/computer.png"; }
        }

        public override string SmallIcon
        {
            get { return "Resources/computer.png"; }
        }

        public override DirectoryInfo DirectoryInfo
        {
            get { return null; }
        }

        protected override List<DirectoryPresentationBase> PopulateChildren()
        {
            var children = new List<DirectoryPresentationBase>();
            Array.ForEach<DriveInfo>(DriveInfo.GetDrives(),
                a => children.Add(new DriveInfoPresentation(a)));
            return children;
        }

        public override bool IsParentOf(DirectoryInfo dir)
        {
            return dir != null;
        }
    }
}
